home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / fx / DeathLaserTrail.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  1.8 KB  |  78 lines

  1. class classes.fx.DeathLaserTrail
  2. {
  3.    var x;
  4.    var y;
  5.    var id;
  6.    var dir;
  7.    var cMax;
  8.    var clip;
  9.    var a;
  10.    var type;
  11.    var axis;
  12.    var rv;
  13.    var xMov = 0;
  14.    var yMov = 0;
  15.    var c = 0;
  16.    var Name = "deathLaserTrail";
  17.    function DeathLaserTrail(px, py, pdir, pid)
  18.    {
  19.       this.x = px;
  20.       this.y = py;
  21.       this.id = pid;
  22.       this.dir = pdir;
  23.       this.cMax = _root.randRange(15,45);
  24.       _root.d = _root.d + 1;
  25.       this.clip = _root.attachMovie("deathLaserTrail","deathLaserTrail" + this.id + "Clip",_root.d);
  26.       this.clip._x = this.x;
  27.       this.clip._y = this.y;
  28.       this.a = _root.randRange(20,80);
  29.       this.clip._alpha = this.a;
  30.       this.type = _root.randRange(1,4);
  31.       if(this.dir == "U" || this.dir == "D")
  32.       {
  33.          this.axis = "y";
  34.       }
  35.       else
  36.       {
  37.          this.axis = "x";
  38.       }
  39.       this.clip.gotoAndStop(this.dir);
  40.       var _loc3_ = _root.randRange(-10,10);
  41.       if(_loc3_ == 0)
  42.       {
  43.          _loc3_ == 1;
  44.       }
  45.       this[this.axis + "Mov"] = _loc3_;
  46.       this.rv = this[this.axis + "Mov"] * _root.randRange2(-0.1,-0.05);
  47.    }
  48.    function move1()
  49.    {
  50.    }
  51.    function move2()
  52.    {
  53.       this[this.axis + "Mov"] *= 1.05;
  54.    }
  55.    function move3()
  56.    {
  57.       this[this.axis + "Mov"] /= 1.05;
  58.    }
  59.    function move4()
  60.    {
  61.       this[this.axis + "Mov"] += this.rv;
  62.    }
  63.    function main()
  64.    {
  65.       this["move" + this.type]();
  66.       this.c = this.c + 1;
  67.       if(this.c >= this.cMax)
  68.       {
  69.          _root.removeFX("deathLaserTrail" + this.id);
  70.       }
  71.       this.clip._alpha = this.a - this.c * (this.a / this.cMax);
  72.       this.x += this.xMov;
  73.       this.y += this.yMov;
  74.       this.clip._x = this.x;
  75.       this.clip._y = this.y;
  76.    }
  77. }
  78.